<template>
    <el-row class="main-cont padd20">
        <el-row class="height100">
            <el-col class="mt20 padd20 maxwidth" v-if="ldsjlist.length>0">
                <el-col class="tl" style="font-size: 18px;">
                    本校【劳动课程】协同教研成果一览
                </el-col>
                <el-col :span="12" class="list" @click.native="goCourse(item)"
                        v-for="item in ldsjlist" key="index">
                    <div class="grid-content bg-white box box-align-center box-pack-between mr20">
                        <div class="left box box-pack-start box-align-center">
                            <el-image :src="item.img" class="img"></el-image>
                            <div class="box box-tb box-pack-start box-align-start ml20" style="width: 50%;">
                                <h3>{{item.name}}</h3>
                                <span>共{{item.num}}章</span>
                                <span class="over-hidden">责任编辑: {{item.chiefEditor}}</span>
                            </div>
                        </div>
                        <div class="box box-tb box-pack-between box-align-end right">
                            <span class="title">{{item.createTime}}</span>
                        </div>
                    </div>
                </el-col>
            </el-col>
            <el-row class="height100 box box-pack-center box-align-center" v-else>
                <el-empty description="暂无数据" image="../../../static/image/nodata/nodata.png"></el-empty>
            </el-row>
        </el-row>
    </el-row>
</template>

<script>
    export default {
        data() {
            return {
                loginInfo: this.$store.state.loginInfo,
                cous: null,
                ldsjlist: [],
                num: 0,
                jyzid: -1,
                schoolid:this.$store.state.schoolId,
            };
        },
        mounted() {
            this.getJyzData();
        },
        methods: {
            getJyzData() {
                this.$api.Admin.getJyzData({
                    'schoolid': this.schoolid
                }).then(res => {
                    if (res.code == '0') {
                        this.jyzid = res.data;
                        this.$store.commit("setJyzid", res.data);
                        this.listLdkc();
                    } else {
                        this.$message.error('请求失败！');
                    }
                })
            },
            listLdkc() {
                this.$api.jyz.xtjyCousList({
                    'jyzid': this.jyzid
                }).then(res => {
                    if (res.code == '0') {
                        this.ldsjlist = res.list;
                        // console.log(this.ldsjlist)
                    } else {
                        this.$message.error('请求失败！');
                    }
                })
            },
            selectXnxq(e) {
                this.xnxq = e;
                this.getTeachPlanInfo();
            },
            goCourse(item) {
                console.log(item)
                this.$router.push({
                    path: "/jxrw/kcxq_tr",
                    query: {
                        id: item.id
                    }
                })
            },
            goSj(item) {
                this.$router.push({
                    path: "/jxrw/sjxq_tr",
                    query: {
                        id: item
                    }
                })
            },
        }
    }
</script>

<style scoped lang="scss">
    .el-table .warning-row {
        background: oldlace;
    }

    .el-table .success-row {
        background: #f0f9eb;
    }

    .maxwidth {
        // max-width: 1400px;
        // margin: 20px auto !important;
        margin-left: 120px;
    }

    .list {
        cursor: pointer;

        &:first-child {
            .grid-content {
                border: 1px dotted #6473F9;
            }
        }
    }

    .tab {
        width: 158px;
        height: 42px;
        line-height: 42px;
        border-radius: 14px;
        border: 1px solid #E5E6F1;
        background-color: #fff;
        font-size: 18px;

        &:first-child {
            border-radius: 14px 0px 0px 14px;
        }

        &:last-child {
            border-radius: 0px 14px 14px 0px;
            border-left: none;
        }

        &.active {
            background: #626BF1;
            color: #fff;
        }
    }

    .grid-content {
        padding: 0 10px;
        margin-top: 20px;
        height: 134px;
        background: #FFFFFF;
        border: 1px solid #fff;
        border-radius: 12px;
        transition: .3s ease-in-out;

        .el-plus {
            display: inline-block;
            width: 32px;
            height: 32px;
            line-height: 26px;
            background: linear-gradient(-13deg, #626BF1, #989BFA);
            border-radius: 16px;
            color: #fff;
            font-size: 26px;
            font-style: normal;
        }

        .img {
            // width: 148px;
            height: 96px;
            border-radius: 12px;
        }

        h3 {
            width: 100%;
            font-size: 24px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: left;
        }

        .left {
            width: 76%;
        }

        .right {
            height: 96px;

            .title {
                width: 134px;
                height: 20px;
                background: #F3F4FB;
                border-radius: 9px;
                color: #939FF4;
                font-size: 14px;
            }

            .delete {
                width: 46px;
                height: 24px;
                background: #FFFFFF;
                border: 1px solid #FF5A77;
                border-radius: 12px;
                color: #FF5A77;
            }
        }

        &:hover {
            border: 1px solid #BEBDE6;
            box-shadow: 2px 6px 13px 0px rgba(225, 227, 245, 0.69);
        }
    }

    .bg-white {
        background-color: #F8F9FC;
    }

    .item {
        margin-top: 50px;
        width: 334px;
        height: 20px;
        background: #F9E0DE;
        border-radius: 10px;

        span {
            color: #E36572;

            i {
                margin-right: 10px;
                display: inline-block;
                width: 48px;
                height: 20px;
                line-height: 20px;
                background: #EE8892;
                border-radius: 3px;
                text-align: center;
                color: #fff;
                font-style: normal;
            }

        }
    }
</style>
